package view;

import java.awt.Dimension;

import command.*;

import javax.swing.*;

@SuppressWarnings("serial")
public class LogScreen extends JPanel {

	protected ChatButton bLog;
	protected JLabel lLogin;
	protected JTextField tLoginField;
	
	public LogScreen(DebugScreen debugWindow)
	{
		initComponents(debugWindow);
	}

	private void initComponents(DebugScreen debugWindow)
	{	
		this.setBorder(BorderFactory.createTitledBorder("Connexion"));
		this.setPreferredSize(new Dimension(100, 200));
		
		lLogin = new JLabel("login");
		tLoginField = new JTextField();
		bLog = new ChatButton("Log in", new LogOn(tLoginField));
		
		Box b1 = Box.createHorizontalBox();
		b1.add(lLogin);
		
		Box b2 = Box.createHorizontalBox();
		b2.add(tLoginField);
		
		Box b3 = Box.createHorizontalBox();
		b3.add(bLog);

	    Box b4 = Box.createVerticalBox();
		b4.add(b1);
		b4.add(b2);
		b4.add(b3);
		b4.setPreferredSize(new Dimension(220, 70));

		this.add(b4);
	}
}
